package com.diors.commons.network.module.model;

import java.lang.reflect.Method;


/**
 * 对应的方法
 * @author darren.ouyang
 * @date 2013-9-10
 */
public class MethodModel 
{

	final Method method;
	
	final CommandInfoModel[] commandInfoModel;
	
	final Object obj;
	
	public MethodModel(Object obj, Method method,CommandInfoModel[] commandInfoModel)
	{
		this.method = method;
		this.commandInfoModel = commandInfoModel;
		this.obj = obj;
	}

	public Method getMethod() 
	{
		return method;
	}

	public CommandInfoModel[] getCommandInfoModel()
	{
		return commandInfoModel;
	}
	
	public void execute(Object obj,Object... objects) throws Exception
	{
		method.invoke(obj, objects);
	}

	public Object getObj()
	{
		return obj;
	}
	
}
